import React, { Component } from 'react';
import { Button } from 'antd';
class anniu extends Component {
  constructor(props) {
    super(props);
    this.state = {
      type: false
    }
  }

  //组件挂载完毕 --用于数据请求
  componentDidMount() { }

  //组件将要卸载
  componentWillUnmount() { }

  render() {
    return (
      <div>
        <Button type="primary" size="large" danger loading={this.state.type} onClick={this.operation}>正常</Button>
      </div>
    );
  }

  operation = () => {
    console.log(1111)
    this.setState({
      type: true
    })
    setTimeout(() => {
      this.setState({
        type: false
      })
    }, 2000)
  }

}

export default anniu;